package com.sls.web.manager.game.pojo.ekhui;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
 * 支付单
 * @author Administrator
 *
 */
public class Payment implements Serializable {
	private static final long serialVersionUID = 2145413320919060556L;
	private String paymentId ;					//支付单id
	private String accountId ;					//支付的账户id
	private String traderId ;					//支付账户所属公司id
	private String currency ;					//币种
	private BigDecimal payMoney ;				//支付总金额
	private Date createTime ;					//支付单生成时间
	private Date payAccountDate ;				//支付账户账务日期
	private String businessTypeId ;				//业务类型
	private String channelId ;					//渠道
	private String payeeAccountId ;				//收款的账户1
	private BigDecimal money ;					//接收账户1接收金额
	//private String payeeAccountStatus ;			//接收账户1收款状态
	private Date payeeAccountDate ;			//接收账户1账务日期
	private String payeeAccount2Id ;			//接收的账户2
	private BigDecimal money2 ;					//接收账户2接收金额
	//private String payeeAccount2Status ;		//接收账户2收款状态
	private Date payeeAccount2Date ;			//接收账户2账户日期
	private String payeeAccount3Id ;			//接收的账户3
	private BigDecimal money3 ;					//接收账户3的接收金额
	//private String payeeAccount3Status ;		//接收账户3收款状态
	private Date payeeAccount3Date ;			//接收账户3账户日期
	private String orderId ;					//支付关联订单
	//private String status ;						//支付状态，0：支付初始状态，1：支付成功，-1：支付失败
	private String remark ;						//备注
	private Date lastModifyTime ;				//最后更新日期
	private Date orderDate ;					//收到订单的支付请求时间
	public Payment() {
		super();
	}
	public String getPaymentId() {
		return paymentId;
	}
	public void setPaymentId(String paymentId) {
		this.paymentId = paymentId;
	}
	public String getAccountId() {
		return accountId;
	}
	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}
	public String getTraderId() {
		return traderId;
	}
	public void setTraderId(String traderId) {
		this.traderId = traderId;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	public BigDecimal getPayMoney() {
		return payMoney;
	}
	public void setPayMoney(BigDecimal payMoney) {
		this.payMoney = payMoney;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getPayAccountDate() {
		return payAccountDate;
	}
	public void setPayAccountDate(Date payAccountDate) {
		this.payAccountDate = payAccountDate;
	}
	public String getBusinessTypeId() {
		return businessTypeId;
	}
	public void setBusinessTypeId(String businessTypeId) {
		this.businessTypeId = businessTypeId;
	}
	public String getChannelId() {
		return channelId;
	}
	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}
	public String getPayeeAccountId() {
		return payeeAccountId;
	}
	public void setPayeeAccountId(String payeeAccountId) {
		this.payeeAccountId = payeeAccountId;
	}
	public BigDecimal getMoney() {
		return money;
	}
	public void setMoney(BigDecimal money) {
		this.money = money;
	}
	public Date getPayeeAccountDate() {
		return payeeAccountDate;
	}
	public void setPayeeAccountDate(Date payeeAccountDate) {
		this.payeeAccountDate = payeeAccountDate;
	}
	public String getPayeeAccount2Id() {
		return payeeAccount2Id;
	}
	public void setPayeeAccount2Id(String payeeAccount2Id) {
		this.payeeAccount2Id = payeeAccount2Id;
	}
	public BigDecimal getMoney2() {
		return money2;
	}
	public void setMoney2(BigDecimal money2) {
		this.money2 = money2;
	}
	public Date getPayeeAccount2Date() {
		return payeeAccount2Date;
	}
	public void setPayeeAccount2Date(Date payeeAccount2Date) {
		this.payeeAccount2Date = payeeAccount2Date;
	}
	public String getPayeeAccount3Id() {
		return payeeAccount3Id;
	}
	public void setPayeeAccount3Id(String payeeAccount3Id) {
		this.payeeAccount3Id = payeeAccount3Id;
	}
	public BigDecimal getMoney3() {
		return money3;
	}
	public void setMoney3(BigDecimal money3) {
		this.money3 = money3;
	}
	public Date getPayeeAccount3Date() {
		return payeeAccount3Date;
	}
	public void setPayeeAccount3Date(Date payeeAccount3Date) {
		this.payeeAccount3Date = payeeAccount3Date;
	}
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getLastModifyTime() {
		return lastModifyTime;
	}
	public void setLastModifyTime(Date lastModifyTime) {
		this.lastModifyTime = lastModifyTime;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	//一付一收，单独考虑
	public Payment savePayment(Account payAccount , Account payeeAccount , BigDecimal money , 
			BigDecimal payMoney , String orderId , Date orderDate){
		this.setAccountId(payAccount.getAccountId()) ;
		this.setCreateTime(new Date()) ;
		this.setCurrency("rmb") ;
		this.setLastModifyTime(new Date()) ;
		this.setPayAccountDate(new Date()) ;
		this.setPayeeAccountId(payeeAccount.getAccountId()) ;
		this.setPayMoney(payMoney) ;
		this.setMoney(money) ;
		this.setPayeeAccountDate(new Date()) ;
		this.setTraderId(payAccount.getTraderId()) ;
		this.setOrderId(orderId) ;
		this.setOrderDate(orderDate) ;
		return this ;
	}
	public Payment savePayment2(Account payAccount , Account payeeAccount , BigDecimal money ){
		this.setPayeeAccount2Id(payeeAccount.getAccountId()) ;
		this.setMoney2(money) ;
		this.setPayeeAccountDate(new Date()) ;
		return this ;
	}
	public Payment savePayment3(Account payAccount , Account payeeAccount , BigDecimal money){
		this.setPayeeAccount3Id(payeeAccount.getAccountId()) ;
		this.setMoney(money) ;
		this.setPayeeAccountDate(new Date()) ;
		return this ;
	}
	public Payment savePayment(Account payAccount , List<Account> payeeAccountList , 
			List<BigDecimal> moneyList, BigDecimal payMoney ,String orderId ,Date orderDate){
		Payment payment = this ;
		payment = this.savePayment( payAccount, payeeAccountList.get(0), moneyList.get(0), 
				payMoney ,orderId , orderDate) ;
		if(payeeAccountList.get(1) != null){
			savePayment2(payAccount , payeeAccountList.get(1) , moneyList.get(1)) ;
		}
		if(payeeAccountList.get(2) != null){
			savePayment3(payAccount , payeeAccountList.get(2) , moneyList.get(2)) ;
		}
		return payment ;
	}
}
